"""配置文件"""
import secrets
from typing import List
from pydantic import BaseSettings


class Settings(BaseSettings):
    """配置类"""
    # # token相关
    # ALGORITHM: str = "HS256"  # 加密算法
    # SECRET_KEY: str = secrets.token_urlsafe(32)  # 随机生成的base64位字符串
    # ACCESS_TOKEN_EXPIRE_MINUTES: int = 60 * 24 * 3  # token的时效 3 天 = 60 * 24 * 3

    # 跨域设置
    ORIGINS: List[str] = ["*", ]

    # 数据库url配置__Mysql
    MYSQL_USER = 'root'
    MYSQL_PASS = '123456'
    MYSQL_HOST = 'localhost'
    MYSQL_PORT = '3306'
    MYSQL_DB = 'heartdb'
    SQLALCHEMY_DATABASE_URL = 'mysql+pymysql://%s:%s@%s:%s/%s' % (MYSQL_USER, MYSQL_PASS, MYSQL_HOST, MYSQL_PORT, MYSQL_DB)


setting = Settings()
